﻿cmake_minimum_required(VERSION 3.23)
project(Projects VERSION 0.1 LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
#set(CMAKE_OBJECT_PATH_MAX 1024)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_INSTALL_QMLDIR qml)
set(CMAKE_INSTALL_PLUGINS ${CMAKE_INSTALL_BINDIR}/Plugins)
option(ENABLED_TESTER "tester add project")
option(ENABLED_EXAMPLES "examples")

set(CMAKE_DEBUG_POSTFIX d)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib)

if (ENABLED_TESTER)
    add_subdirectory(${PROJECT_SOURCE_DIR}/test)
    set(ENABLED_AUXILIARY_LIBRARY True)
endif()
if (ENABLED_EXAMPLES)
    add_subdirectory(${PROJECT_SOURCE_DIR}/examples)
endif()
add_subdirectory(${PROJECT_SOURCE_DIR}/src)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/config DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/3rdpart_library/license  DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/3rdpart_library/gen.config DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/3rdpart_library/GenDefaultLicense.exe DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/3rdpart_library/libcrypto-3-x64.dll DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/3rdpart_library/libssl-3-x64.dll DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/3rdpart_library/Registor.exe DESTINATION ${CMAKE_INSTALL_BINDIR})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(CPack)